var amqp = require('amqplib/callback_api');
amqp.connect('amqp://localhost', function(err, conn) {
	conn.createChannel(function(err, ch) {
		var q = 'task_queue';
		ch.assertQueue(q, {
			durable: false
		});
		ch.sendToQueue(q, new Buffer('Hello World!'));
		console.log(" [x] Sent 'Hello World!'");

		// close
		setTimeout(function() {
			conn.close();
			process.exit(0)
		}, 500);
	})
});